package com.byb.server.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 赔偿金额评分规则
 */
@ApiModel(description = "赔偿金额评分规则")
@Entity
@Table(name = "pay_rule_description")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "payruledescription")
public class PayRuleDescription implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 赔偿金额评分规则
     */
    @ApiModelProperty(value = "赔偿金额评分规则")
    @Column(name = "info")
    private String info;

    /**
     * 分数计算公式描述
     */
    @ApiModelProperty(value = "分数计算公式描述")
    @Column(name = "formula_description")
    private String formulaDescription;

    // jhipster-needle-entity-add-field - Jhipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getInfo() {
        return info;
    }

    public PayRuleDescription info(String info) {
        this.info = info;
        return this;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getFormulaDescription() {
        return formulaDescription;
    }

    public PayRuleDescription formulaDescription(String formulaDescription) {
        this.formulaDescription = formulaDescription;
        return this;
    }

    public void setFormulaDescription(String formulaDescription) {
        this.formulaDescription = formulaDescription;
    }
    // jhipster-needle-entity-add-getters-setters - Jhipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PayRuleDescription payRuleDescription = (PayRuleDescription) o;
        if (payRuleDescription.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), payRuleDescription.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "PayRuleDescription{" +
            "id=" + getId() +
            ", info='" + getInfo() + "'" +
            ", formulaDescription='" + getFormulaDescription() + "'" +
            "}";
    }
}
